<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.hs.core.utils.*"%>
<%@page import="cn.ac.cintcm.dataconverge.util.Constants"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String userId =  request.getParameter("userId");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title><%=Constants.APP_TITLE %>---修改密码</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	 <script src='<%=basePath%>dwr/engine.js'></script>
     <script src='<%=basePath%>dwr/util.js'></script> 
     <script src='<%=basePath%>dwr/interface/subject.js'></script> 
      <script language="javascript" src="<%=path %>/js/common.js"></script>
     <link href="<%=path %>/index/Themes/com/style.css" type="text/css" rel="stylesheet"></link>
     <script type="text/javascript">
     function modifyPass(){
        var userId = '<%=userId%>';
     	var oldpass = dwr.util.getValue("oldPassword");
     	var newpass = dwr.util.getValue("newPassword");
     	var confirmpass = dwr.util.getValue("confirmPassword");
        if(isNull(oldpass)){
        	alert("请输入原密码"); 
        	form1.oldPassword.focus();
        	return;
        }
        if(isNull(newpass)){
        	alert("请输入新密码"); 
        	form1.newPassword.focus();
        	return;
        }
        if(isNull(confirmpass)){
        	alert("请输入确认密码"); 
        	form1.confirmPassword.focus();
        	return;
        }
        if(newpass == confirmpass){
           subject.modifyPassword(userId,oldpass,newpass,modifyCallBack)
        }else{ 
          alert("新密码与确认密码不一致");
        } 
     } 
     
     function modifyCallBack(message){
     	if(message == '0'){
     	
     			alert("密码修改成功");
     	}
     	if(message == '1'){
     	
     			alert("原密码错误");
     	}
     	if(message == '2'){
     	
     			alert("密码修改失败");
     	}
     	
     
     
     
     }
     </script>
  </head> 
 <body class="idt_body" scroll="no">
  <form name="form1" method="post">
    <table cellpadding="0" cellspacing="0" width="100%" height="100%" id="Table8">
        <tr>
            <td valign="top" height="100%">
                <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" id="Table11">
                    <tr>
                        <td class="idt_main_m">
                            <!------------------ 标题栏 ------------------>
                            <!--- 标题 ---->
                           
                            <table class="idt_tle_mg" cellspacing="0" cellpadding="0" width="100%">
                                <tr onclick="javascript:OnShow(tdForm,imgForm6);">
                                    <td class="idt_tle_i">
                                        <img id="imgForm6" src="<%=path %>/index/Themes/com/idt_tle_o.gif"></td>
                                    <td class="idt_tle_f1">
                                        修改密码</td>
                                </tr>
                            </table>
                            <!--- 内容 --->
                           
                            <div id="tdForm">
                             
                                <table border="0" cellpadding="0" cellspacing="1" width="100%" class="com_fieldset_tab">
                                    <tr>
                                        <td class="fim_l">
                                            旧密码</td>
                                        <td class="fim_r">
                                            <input type="password" class="com_textbox" id="oldPassword" name="oldPassword" value=""></td>
                                         
                                    </tr>
                                    <tr>
                                        <td class="fim_l">
                                            新密码</td>
                                        <td class="fim_r">
                                            <input type="password" class="com_textbox" id="newPassword" name=""newPassword"" value=""></td> 
                                    </tr>
                                    <tr>
                                        <td class="fim_l">
                                            密码确认</td>
                                        <td class="fim_r">
                                            <input type="password" class="com_textbox" id="confirmPassword" name="confirmPassword" value=""></td> 
                                    </tr>
                                </table>
                               
                                <table cellspacing="0" cellpadding="0" width="100%" class="idt_bottom_mg" border="0">
                                    <tr>
                                        <td align="right">
                                            <input type="button" value="保存" name="B3" class="com_btn2"   onclick="javascript:modifyPass();">
                                            <input type="button" value="关闭" name="B4" class="com_btn2"   onclick="javascript:window.close();">
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            
                </table> 
                 </form>
</body>
</html>

